﻿using FPSO.Models.Domain;
using FPSO.Services.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FPSO.Services.Impl
{
    public class RealDataBindingServiceImpl<T> : IDataBindingService
    {
        private TSMapperBrige valueBrige;
        public RealDataBindingServiceImpl(string pdbConnStr, T viewModel)
        {
            SnapTSService tsService = new SnapTSService();
            tsService.ConnStr = pdbConnStr;
            valueBrige = new TSMapperBrige(tsService);
            valueBrige.InitDataContext(viewModel);
        }

        public void ReflushData(DateTime currentTime)
        {
			//valueBrige.UpdateValues();
			valueBrige.UpdateValues_tagList();
		}

		public void ReflushData(ManualCalcResult calcResult)
        {
            valueBrige.UpdateValues(calcResult);
        }
    }
}
